/**
 * MemberResourceStatus.java
 * 
 * Copyright@2015 OVT Inc. All rights reserved. 
 * 
 * Dec 29, 2015
 */
package com.ovt.doorbell.payment.dao.constant;

/**
 * MemberResourceStatus
 * 
 * @Author zhi.liu
 * @Version 1.0
 * @See 
 * @Since [OVT Cloud Platform]/[API] 1.0
 */
public enum MemberResourceStatus
{

    ACTIVE, CANCELLED, EXPIRED, INACTIVE;
    
    public static MemberResourceStatus getResourceType(String status)
    {
        if(status == null)
        {
            return null;
        }
        
        if("active".equals(status.toLowerCase()))
        {
            return ACTIVE;
        }
        else if("cancelled".equals(status.toLowerCase()))
        {
            return CANCELLED;
        }
        else if("expire".equals(status.toLowerCase()))
        {
            return EXPIRED;
        }
        
        return null;
    }
    
    public static String getTypeString(MemberResourceStatus status)
    {
        if(status == null)
        {
            return null;
        }
        
        if(status == ACTIVE)
        {
            return "Active";
        }
        else if(status == CANCELLED)
        {
            return "Cancelled";
        }
        else if(status == EXPIRED)
        {
            return "Expire";
        }
        
        return null;
        
    }
    
}
